3.7.1 \(\int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx\)

Optimal. Leaf size=228 \[ \frac {\sqrt {a e^2-b d e+c d^2} \tanh ^{-1}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\sqrt {a g^2-b f g+c f^2} \tanh ^{-1}\left (\frac {-2 a g+x (2 c f-b g)+b f}{2 \sqrt {a+b x+c x^2} \sqrt {a g^2-b f g+c f^2}}\right )}{g (e f-d g)}+\frac {\sqrt {c} \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{e g} \]

________________________________________________________________________________________

Rubi [A]  time = 0.33, antiderivative size = 228, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {895, 724, 206, 843, 621} \begin {gather*} \frac {\sqrt {a e^2-b d e+c d^2} \tanh ^{-1}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\sqrt {a g^2-b f g+c f^2} \tanh ^{-1}\left (\frac {-2 a g+x (2 c f-b g)+b f}{2 \sqrt {a+b x+c x^2} \sqrt {a g^2-b f g+c f^2}}\right )}{g (e f-d g)}+\frac {\sqrt {c} \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{e g} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*x + c*x^2]/((d + e*x)*(f + g*x)),x]

[Out]

(Sqrt[c]*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(e*g) + (Sqrt[c*d^2 - b*d*e + a*e^2]*ArcTanh[
(b*d - 2*a*e + (2*c*d - b*e)*x)/(2*Sqrt[c*d^2 - b*d*e + a*e^2]*Sqrt[a + b*x + c*x^2])])/(e*(e*f - d*g)) - (Sqr
t[c*f^2 - b*f*g + a*g^2]*ArcTanh[(b*f - 2*a*g + (2*c*f - b*g)*x)/(2*Sqrt[c*f^2 - b*f*g + a*g^2]*Sqrt[a + b*x +
 c*x^2])])/(g*(e*f - d*g))

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 621

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 724

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rule 895

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)/(((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))), x_Symbol] :> Dist[(c
*d^2 - b*d*e + a*e^2)/(e*(e*f - d*g)), Int[(a + b*x + c*x^2)^(p - 1)/(d + e*x), x], x] - Dist[1/(e*(e*f - d*g)
), Int[(Simp[c*d*f - b*e*f + a*e*g - c*(e*f - d*g)*x, x]*(a + b*x + c*x^2)^(p - 1))/(f + g*x), x], x] /; FreeQ
[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && Fra
ctionQ[p] && GtQ[p, 0]

Rubi steps

\begin {align*} \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx &=-\frac {\int \frac {c d f-b e f+a e g-c (e f-d g) x}{(f+g x) \sqrt {a+b x+c x^2}} \, dx}{e (e f-d g)}+\frac {\left (c d^2-b d e+a e^2\right ) \int \frac {1}{(d+e x) \sqrt {a+b x+c x^2}} \, dx}{e (e f-d g)}\\ &=\frac {c \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{e g}-\frac {\left (2 \left (c d^2-b d e+a e^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{4 c d^2-4 b d e+4 a e^2-x^2} \, dx,x,\frac {-b d+2 a e-(2 c d-b e) x}{\sqrt {a+b x+c x^2}}\right )}{e (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right ) \int \frac {1}{(f+g x) \sqrt {a+b x+c x^2}} \, dx}{g (e f-d g)}\\ &=\frac {\sqrt {c d^2-b d e+a e^2} \tanh ^{-1}\left (\frac {b d-2 a e+(2 c d-b e) x}{2 \sqrt {c d^2-b d e+a e^2} \sqrt {a+b x+c x^2}}\right )}{e (e f-d g)}+\frac {(2 c) \operatorname {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{e g}+\frac {\left (2 \left (c f^2-b f g+a g^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{4 c f^2-4 b f g+4 a g^2-x^2} \, dx,x,\frac {-b f+2 a g-(2 c f-b g) x}{\sqrt {a+b x+c x^2}}\right )}{g (e f-d g)}\\ &=\frac {\sqrt {c} \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{e g}+\frac {\sqrt {c d^2-b d e+a e^2} \tanh ^{-1}\left (\frac {b d-2 a e+(2 c d-b e) x}{2 \sqrt {c d^2-b d e+a e^2} \sqrt {a+b x+c x^2}}\right )}{e (e f-d g)}-\frac {\sqrt {c f^2-b f g+a g^2} \tanh ^{-1}\left (\frac {b f-2 a g+(2 c f-b g) x}{2 \sqrt {c f^2-b f g+a g^2} \sqrt {a+b x+c x^2}}\right )}{g (e f-d g)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.34, size = 218, normalized size = 0.96 \begin {gather*} \frac {g \sqrt {a e^2-b d e+c d^2} \tanh ^{-1}\left (\frac {-2 a e+b d-b e x+2 c d x}{2 \sqrt {a+x (b+c x)} \sqrt {a e^2-b d e+c d^2}}\right )+\sqrt {c} (e f-d g) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+x (b+c x)}}\right )-e \sqrt {a g^2-b f g+c f^2} \tanh ^{-1}\left (\frac {-2 a g+b f-b g x+2 c f x}{2 \sqrt {a+x (b+c x)} \sqrt {a g^2-b f g+c f^2}}\right )}{e g (e f-d g)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b*x + c*x^2]/((d + e*x)*(f + g*x)),x]

[Out]

(Sqrt[c]*(e*f - d*g)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + x*(b + c*x)])] + Sqrt[c*d^2 - b*d*e + a*e^2]*g*Ar
cTanh[(b*d - 2*a*e + 2*c*d*x - b*e*x)/(2*Sqrt[c*d^2 - b*d*e + a*e^2]*Sqrt[a + x*(b + c*x)])] - e*Sqrt[c*f^2 -
b*f*g + a*g^2]*ArcTanh[(b*f - 2*a*g + 2*c*f*x - b*g*x)/(2*Sqrt[c*f^2 - b*f*g + a*g^2]*Sqrt[a + x*(b + c*x)])])
/(e*g*(e*f - d*g))

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.70, size = 315, normalized size = 1.38 \begin {gather*} \frac {2 \sqrt {-a e^2+b d e-c d^2} \tan ^{-1}\left (-\frac {e \sqrt {a+b x+c x^2}}{\sqrt {-a e^2+b d e-c d^2}}+\frac {\sqrt {c} e x}{\sqrt {-a e^2+b d e-c d^2}}+\frac {\sqrt {c} d}{\sqrt {-a e^2+b d e-c d^2}}\right )}{e (e f-d g)}+\frac {2 \sqrt {-a g^2+b f g-c f^2} \tan ^{-1}\left (-\frac {g \sqrt {a+b x+c x^2}}{\sqrt {-a g^2+b f g-c f^2}}+\frac {\sqrt {c} g x}{\sqrt {-a g^2+b f g-c f^2}}+\frac {\sqrt {c} f}{\sqrt {-a g^2+b f g-c f^2}}\right )}{g (d g-e f)}-\frac {\sqrt {c} \log \left (-2 \sqrt {c} e g \sqrt {a+b x+c x^2}+b e g+2 c e g x\right )}{e g} \end {gather*}

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[Sqrt[a + b*x + c*x^2]/((d + e*x)*(f + g*x)),x]

[Out]

(2*Sqrt[-(c*d^2) + b*d*e - a*e^2]*ArcTan[(Sqrt[c]*d)/Sqrt[-(c*d^2) + b*d*e - a*e^2] + (Sqrt[c]*e*x)/Sqrt[-(c*d
^2) + b*d*e - a*e^2] - (e*Sqrt[a + b*x + c*x^2])/Sqrt[-(c*d^2) + b*d*e - a*e^2]])/(e*(e*f - d*g)) + (2*Sqrt[-(
c*f^2) + b*f*g - a*g^2]*ArcTan[(Sqrt[c]*f)/Sqrt[-(c*f^2) + b*f*g - a*g^2] + (Sqrt[c]*g*x)/Sqrt[-(c*f^2) + b*f*
g - a*g^2] - (g*Sqrt[a + b*x + c*x^2])/Sqrt[-(c*f^2) + b*f*g - a*g^2]])/(g*(-(e*f) + d*g)) - (Sqrt[c]*Log[b*e*
g + 2*c*e*g*x - 2*Sqrt[c]*e*g*Sqrt[a + b*x + c*x^2]])/(e*g)

________________________________________________________________________________________

fricas [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:sym2
poly/r2sym(const gen & e,const index_m & i,const vecteur & l) Error: Bad Argument Value

________________________________________________________________________________________

maple [B]  time = 0.03, size = 1529, normalized size = 6.71

result too large to display

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x)

[Out]

1/(d*g-e*f)*((x+f/g)^2*c+(b*g-2*c*f)/g*(x+f/g)+(a*g^2-b*f*g+c*f^2)/g^2)^(1/2)+1/2/(d*g-e*f)*ln((1/2*(b*g-2*c*f
)/g+c*(x+f/g))/c^(1/2)+((x+f/g)^2*c+(b*g-2*c*f)/g*(x+f/g)+(a*g^2-b*f*g+c*f^2)/g^2)^(1/2))/c^(1/2)*b-1/(d*g-e*f
)/g*ln((1/2*(b*g-2*c*f)/g+c*(x+f/g))/c^(1/2)+((x+f/g)^2*c+(b*g-2*c*f)/g*(x+f/g)+(a*g^2-b*f*g+c*f^2)/g^2)^(1/2)
)*c^(1/2)*f-1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e)/e+2*(a*e^2-b*d*e+c*d^2)/e^2+2*((a*e^2-b*d*
e+c*d^2)/e^2)^(1/2)*((x+d/e)^2*c+(b*e-2*c*d)*(x+d/e)/e+(a*e^2-b*d*e+c*d^2)/e^2)^(1/2))/(x+d/e))*a-1/(d*g-e*f)/
e/((a*e^2-b*d*e+c*d^2)/e^2)^(1/2)*ln(((b*e-2*c*d)*(x+d/e)/e+2*(a*e^2-b*d*e+c*d^2)/e^2+2*((a*e^2-b*d*e+c*d^2)/e
^2)^(1/2)*((x+d/e)^2*c+(b*e-2*c*d)*(x+d/e)/e+(a*e^2-b*d*e+c*d^2)/e^2)^(1/2))/(x+d/e))*b*d+1/(d*g-e*f)/e^2/((a*
e^2-b*d*e+c*d^2)/e^2)^(1/2)*ln(((b*e-2*c*d)*(x+d/e)/e+2*(a*e^2-b*d*e+c*d^2)/e^2+2*((a*e^2-b*d*e+c*d^2)/e^2)^(1
/2)*((x+d/e)^2*c+(b*e-2*c*d)*(x+d/e)/e+(a*e^2-b*d*e+c*d^2)/e^2)^(1/2))/(x+d/e))*c*d^2

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(d*g-e*f>0)', see `assume?` for
 more details)Is d*g-e*f zero or nonzero?

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\sqrt {c\,x^2+b\,x+a}}{\left (f+g\,x\right )\,\left (d+e\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x + c*x^2)^(1/2)/((f + g*x)*(d + e*x)),x)

[Out]

int((a + b*x + c*x^2)^(1/2)/((f + g*x)*(d + e*x)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {a + b x + c x^{2}}}{\left (d + e x\right ) \left (f + g x\right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x**2+b*x+a)**(1/2)/(e*x+d)/(g*x+f),x)

[Out]

Integral(sqrt(a + b*x + c*x**2)/((d + e*x)*(f + g*x)), x)

________________________________________________________________________________________